use talktive::MessageRole;

#[derive(Debug, Clone)]
pub enum Role {
    User,
    Assistant,
    System,
    Observation,
}

impl MessageRole for Role {
    fn from_str(role_name: &str) -> Option<Self> {
        match role_name {
            "user" => Some(Self::User),
            "assistant" => Some(Self::Assistant),
            "system" => Some(Self::System),
            "observation" => Some(Self::Observation),
            _ => None,
        }
    }

    fn to_str(&self) -> &str {
        match self {
            Role::User => "user",
            Role::Assistant => "assistant",
            Role::System => "system",
            Role::Observation => "observation",
        }
    }

    fn assiatant() -> Self {
        Self::Assistant
    }

    fn user() -> Self {
        Self::User
    }

    fn system() -> Self {
        Self::System
    }

    fn observation() -> Self {
        Self::Observation
    }
}
